f2f539eb1725cadcb71c977eb0d199c65c0cbc88,plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleAuditListener.java,CheckstyleAuditListener,getLineId,#AuditEvent#,114
Before Change
private int getLineId(AuditEvent event) {
try {
return event.getLine();
} catch (Exception e) {
// checkstyle can throw a NullPointer if the message is not set
After Change
static Integer getLineId(AuditEvent event) {
try {
int line = event.getLine();
// checkstyle returns 0 if there is no relation to a file content, but we use null
return line == 0 ? null : line;
} catch (Exception e) {
// checkstyle can throw a NullPointerException if the message is not set